//string 拼接操作
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s1="Hello";
    string s2="World";

    s1=s1+" ";
    cout<<s1+s2;

    string s3="NUAA";
    cout<<"s3:";
    cout<<s3<<endl;
    s3.append(s3);//将s3连接到自身
    cout<<"s3:";
    cout<<s3<<endl;
    s3.append("5201314",3);//追加前三个字符“520”
    cout<<"s3:";
    cout<<s3<<endl;
    s3.append("5201314",3,4);//从第3个字符开始追加4个字符
    cout<<"s3:";
    cout<<s3<<endl;

    string s4="nuaaer";
    s4.push_back('6');//注意插入末尾的是字符‘6’
    s4.push_back('6');
    s4.push_back('6');

    cout<<"s4;";
    cout<<s4<<endl;

    return 0;
}